PATHMac OS 8 and 9 Developer Documentation > Interapplication Communication > AppleScript for Scripters >

AppleScript Language Guide

   

How AppleScript Works

AppleScript works by sending messages, called Apple events, to applications. When you write a script, you write one or more groups of instructions called statements. When you run the script, the Script Editor sends these statements to the AppleScript extension, which interprets the statements and sends Apple events to the appropriate applications. Figure 2-5 shows the relationship between the Script Editor, the AppleScript extension, and the application.

Applications respond to Apple events by performing actions, such as inserting text, getting a value, or opening a document. Applications can also send Apple events back to the AppleScript extension to report results. The AppleScript extension sends the final results to the Script Editor, where they are typically displayed in the result window. (You can use the Show Result command to open the result window.)

Figure 2-5   How AppleScript works

Most scripters don't need to be concerned about Apple events or the AppleScript extension. You just use the AppleScript language to request the actions or results that you want. To find out what scriptable actions an application provides, see Dictionaries.


© 1999 Apple Computer, Inc. – (Last Updated 21 May 99)